/*-------------------------------------------------------------
       _                         
 _   _(_) __ _ _ __ _____      __
| | | | |/ _` | '__/ _ \ \ /\ / /
| |_| | | (_| | | | (_) \ V  V / 
\__ , |_|\__, |_|  \___/ \_/\_/  
 |___/   |___/ Author:SharpQian  
(C)2023 KunMing SHHOO  昆明尚禾农业科技有限公司   

----------------------------------------------------------------*/
import { RedisGatewayClass } from "./lib/redis_gateway";
let RedisGateway = new RedisGatewayClass();
RedisGateway.on("message", redisParser);
import AcruatorCmd from './func/actuatorCmd';
import { config } from "./device/loRaModbusTcp"
config()
/**
 * Redis订阅数据处理
 * @param {*} channel  Redis通道
 * @param {*} message 接收信息
 */
function redisParser(channel: string, message: string) {
    switch (channel) {
        case 'ACTUATOR': //执行器指令
            // console.log(`${new Date().toLocaleString()}`, '【index.ts/<redisParser>】', channel, message);
            AcruatorCmd.Parser(RedisGateway, message);
            break;
        default:
            break;
    }
}